<?php
/**************************************************/
/* Programmer: Scott Gildersleeve                 */
/*       Date: 2/2/2013                           */
/*  Page Name: functions.php                      */
/*                                                */
/**************************************************/

/**************************************************/
/* Various PHP functions                          */
/*                                                */
/**************************************************/

/****************************************************************/
/*   Date        Reviser       Revision           				*/
/* --------     ---------     ----------          				*/
/* 2/2/13       S. Gilder      Add check_login()  				*/
/* 2/11/13	    D. Widjaya     Add populate_dropdown_options() 	*/
/*                                                				*/
/****************************************************************/

/* Check if required information is stored */
function check_login() {
    return isset($_SESSION['email']);
}
   
/* Popupate a dropdown given an array list of data with id and name column */
function populate_dropdown_options($DataTable)
{
  $string = "";
  if($DataTable != null)
  {		
		 foreach ($DataTable as $row) 
		 {
			  $string .= '<option value="' . $row['id'] . '">' . $row['name'] . '</option>';
		 }
	 return $string;
  }
  return null;
}
   
/* NEEDS DOCUMENTATION */
function create_new_test($first)
{
  $first = 0;
}
?>